package com.threeonemeeting.model;

import android.app.Activity;
import android.content.Context;

/**
 * 
 * @author zhangzhongqing
 * @param 屏幕相关的数据
 */
public class ScreenInfo {

	private Context context;
	private Integer nHorizontalSize; // 水平尺寸
	private Integer nVerticalSize; // 垂直尺寸
	private Integer nColorBits; //

	private static ScreenInfo screenInfo = new ScreenInfo();

	public static ScreenInfo getInstance(Context ctx) {
		screenInfo.context = ctx;
		screenInfo.initValue();
		return screenInfo;
	}

	private ScreenInfo() {
	}

	public void initValue() {

		Activity activity = (Activity) context;
		nHorizontalSize = activity.getWindowManager().getDefaultDisplay()
				.getWidth();
		nVerticalSize = activity.getWindowManager().getDefaultDisplay()
				.getHeight();
	}

	public String getSizeString() {
		return nHorizontalSize + "x" + nVerticalSize;
	}

	public Integer getHorizontalSize() {
		return this.nHorizontalSize;
	}

	public Integer getVerticalSize() {
		return this.nVerticalSize;
	}

	public Integer getColorBits() {
		return this.nColorBits;
	}
}